from django.urls import path
from django.views.decorators.http import require_GET, require_POST
from article import views


urlpatterns = [
    # 文章相关
    path('upload-article/', require_POST(views.UploadArticle.as_view())),
    path('get-article/', require_GET(views.GetArticle.as_view())),
    path('delete-article/', require_GET(views.DeleteArticle.as_view())),
    path('list-article/', require_GET(views.ListArticle.as_view())),
    path('list-self-article/', require_GET(views.ListSelfArticle.as_view())),
    path('list-star-user-article/', require_GET(views.ListStaredUserArticle.as_view())),

    # 评论
    path('comment-article/', require_POST(views.CommentArticle.as_view())),
    path('list-article-comment/', require_GET(views.ListArticleComment.as_view())),
    path('list-article-child-comment/', require_GET(views.ListArticleChildComment.as_view())),
    path('article-comment-up/', require_GET(views.ArticleCommentUp.as_view())),

    # 文件上传
    path('upload-file/', require_POST(views.UploadFile.as_view())),
    path('upload-image/', require_POST(views.UploadImage.as_view())),
    path('upload-media/', require_POST(views.UploadMedia.as_view())),
]
